package com.emergency.db.domain.item;

import com.emergency.base.domain.BaseEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;


//中小型设备状态表
@Entity
@Table(name = "bas_tiny_status")
@EntityListeners(AuditingEntityListener.class)
public class TinyItemStatus extends BaseEntity {

    private String name;//装备名称

    private Long durable;//可工作时间/秒

    private Long workTime;//已工作时间

    private double dose;//累计剂量

    private String status;//装备使用状态；枚举。0.完好；1.不影响使用；2.部分功能缺失；3.影响防护；4.报废

    @OneToOne(targetEntity = Item.class, fetch = FetchType.LAZY)
    @JoinColumn(name = "item_id", referencedColumnName = "id")
    private Item item;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getDurable() {
        return durable;
    }

    public void setDurable(Long durable) {
        this.durable = durable;
    }

    public Long getWorkTime() {
        return workTime;
    }

    public void setWorkTime(Long workTime) {
        this.workTime = workTime;
    }

    public double getDose() {
        return dose;
    }

    public void setDose(double dose) {
        this.dose = dose;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Item getItem() {
        return item;
    }

    public void setItem(Item item) {
        this.item = item;
    }
}
